The RTF Help article that appeared in newsletter 115 showed how you can make your own Rich Text Format help file for a program. This is useful when you want to include a manual with a program or other large help file. But when you create large programs it is often advantages to have extra help at each window operation which will describe that window operation in more detail. The basic file windowhelp.bas contains a demonstration window and a
gosub [help]subroutine that displays an RTF help file for each window.
The principle is that you create a Rich Text Format help file for each window. I find it useful to name them help1.rtf, help2.rtf etc. Then I place a "Help" button on each window that will branch to the following sample routine.
[help21] help$="help21.rtf":gosub [help]:wait
This could also be done with a call subroutine as long as you pass the help$ into the sub.
I use a dialog_modal type window to actually display the help, that way I know that the user must close the help window before proceeding and I don't have to worry whether it is closed or not. I also include a "Printer" button on the help window so that the user can print the help file. This is done in the line
run "write.exe "+chr$(34)+File$+chr$(34)+" /p",hide
This tells WordPad to print the file and to remain hidden while it does it.
The program is complete with tool tips and window centering for both windows and will also show you how a default button works for a dialog window. As a last suggestion, I create the RTF files in Word. After saving them, I open them in Word Pad. I then open the Page Setup, set all margins for .5 inches and save the file again as an RTF file. This will reduce the size of the help files considerably.
- Jim Brossman
Please see the zip archive of this issue for the source code and associated files for this article.